function PreviewPicture(selector, mySetting) {
    function PreviewPicture(selector, mySetting) { this.addBox = document.querySelector(selector);
        this.index = 0;
        this.aInput = [];
        this.setting = { addTrue: function(oInput, oFiles, oImage) {}, addFalse: function() { alert("只能选择图片") } };
        for (var attr in mySetting) { this.setting[attr] = mySetting[attr] }
        this.init() }
    PreviewPicture.prototype = { init: function() {
            var _this = this;
            this.addBox.addEventListener("click", function() { _this.openWindow() }, false) }, openWindow: function(obj) {
            var _this = this;
            if (obj) {
                return obj.click() }
            var aInput = this.aInput;
            for (var i = 0; i < aInput.length; i++) {
                if (aInput[i].files.length == 0) {
                    return aInput[i].click() } }
            var oFile = document.createElement("input");
            oFile.type = "file";
            oFile.style.display = "none";
            _this.index++;
            oFile.name = "file" + _this.index;
            oFile.addEventListener("change", function() { _this.change(this); $('body').addClass('load'); }, false);
            aInput.push(oFile);
            console.log(aInput);
            return aInput[aInput.length - 1].click() }, change: function(oFile) {
            var oFiles = oFile.files[0];
            var _this = this;
            if (oFiles && /image\/\w+/.test(oFiles.type)) {
                var reader = new FileReader;
                reader.readAsDataURL(oFiles);
                reader.onload = function(e) { _this.setting.addTrue(oFile, oFiles, this); $('body').removeClass('load') } } else { this.setting.addFalse() } } };
    return new PreviewPicture(selector, mySetting) }
